<?php
namespace app\index\controller;

//load_trait('brximl/brx');
//  首页号航
//use think\Controller;-
use think\Request;
use think\Session;
use think\Loader;
use think\Db;
class Index extends \think\Controller
{
    use \traits\brximl\brx;
    public function index()
    {
        $this->useFrontFk();
        $this->loadScript([
            'title'=>'TeCener-技术交流中心','js'=>['TeC','index/index'],'css'=>['TeC','index/index']
        ]);
        $this->assign('index_nav_view',index_nav($this));

        $ucode = $this->infoUser('user_code');
        $plist = '';
        if($ucode){
            $data = Db::table('project_dev')->alias('a')
                ->join('project_list b','a.pro_code=b.pro_code')
                ->where(['a.user_code'=>$ucode])
                ->field('a.pro_code,b.edittm,b.pro_name')
                ->select()
            ;            
            foreach($data as $v){
                $plist .= '<a href="/Tecenter/index/project.html?uid='.$v['pro_code'].'" class="list-group-item" target="_blank" title="'.$v['edittm'].'">'.$v['pro_code'].' #'.$v['pro_name'].'</a>';
            }                    
            //debugOut($data);
        }
        $plist .= '<a class="list-group-item" href="/TeCenter/index/project/paction/list.html" target="_blank">+ 新增</a>'; 
        $this->assign('idpList',$plist);
        
        $this->assign('addreInfo',$this->_addreInfo());
        return $this->fetch('index');
    }
    // API/地址信息
    private function _addreInfo(){
        $xhtml = '';
        //$data = curNet();debugOut($data,true);
        return $xhtml;
    }
    public function info()
    {
        phpinfo();
    }
    public function test()
    {
        Session::set('test','Fuccccck');
        return '<pre>'.
            print_r(Request::instance()->session(),true).'<br>'.
            print_r(request()->session(),true).'<br>'.
            print_r($this->infoUser(),true).'<br>'.
            print_r(Session::get(),true);
    }
}
